<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: qinfeng
  Date: 2021/10/7
  Time: 16:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>顶部导航栏购物车</title>
</head>
<body>
<%--<c:if test="${user != null}">"  </c:if>>--%>
<div class="topbar-cart" >
    <a <c:if test="${user != null}">href="/mi/cart/shopping_cart"</c:if> <c:if test="${user == null}">href="/mi/login"</c:if> target="_blank" ><em class="iconfont icon-gouwuchekong"> </em>购物车<span
            class="cart-num" ><c:if test="${user != null}">(${carts.size()})</c:if><c:if test="${user == null}">(0)</c:if></span></a>
    <div class="cart-menu" id="headerCart" style="cursor: pointer; z-index: 100000; ">
        <div class="menu-content" style="padding: 0px">
            <div class="loading">
                <div class="loader"></div>
                <ul class="cart-list hide">
                    <c:if test="${user != null}">
                        <c:forEach items="${carts}" var="c" varStatus="xh">
                            <li style="position: relative;height: 67px;">
                                <img width="60px" height="60px" style="position: absolute;left: -10px;" src="${products.get(xh.index).picImg}" alt="">
                                <span style="position: absolute;left: 65px;top: 10px;">${c.paraName}</span>
                                <span style="position: absolute;left: 64px;top: 24px;">${c.paraPrice} X ${c.num}</span>
                            </li>
                        </c:forEach>
                    </c:if>
                </ul>
                <div class="cart-total hide" style="width: 316px;position: relative;float: left;left: -20px;background-color: rgb(250, 250, 250);">
                    <div style="float: left;margin-left: 13px;margin-top: 10px;">
                        <c:if test="${user != null}">
                            <span style="float:left;">共${totalNum}件商品</span>
                            <div style="font-size: 24px;color: rgb(255, 103, 0);margin-top: 10px;">${totalPrice}<span style="font-size: 9px">元</span></div>

                         </c:if>
                    </div>
                    <c:if test="${user != null}">

                        <div style="float: right;margin-top: 11px;margin-right: 10px;"><a href="/mi/cart/shopping_cart" target="_blank" style="float: right;width: 130px;padding: 0;font-size: 14px;line-height: 40px;text-align: center;color: #f5f5f5;background: #ff6700;">去购物车结算</a></div>
                    </c:if>
                </div>
                <c:if test="${user == null}"> <div class="msg-empty hide">购物车中还没有商品,赶紧选购吧!</div></c:if>
            </div>
        </div>
    </div>
</div>
<script src="/mi/plugins/jquery/jquery.min.js"></script>
<script>

</script>
</body>
</html>
